<head>
    <meta charset="utf-8">
    <meta name="robots" content="all,follow">
    <meta name="googlebot" content="index,follow,snippet,archive">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    {{ $is_docs := eq .Type "docs"}}
    {{ $title_plain := .Title | markdownify | plainify }}
    {{ $description_plain := default .Site.Params.defaultDescription .Description | markdownify | plainify }}
    {{ $keywords := default .Site.Params.defaultKeywords .Keywords}}
    {{ if gt (len $keywords) 0 }}
        <meta name="keywords" content="{{ delimit (uniq $keywords) ", " }}">
    {{ end }}
    {{ if $is_docs}}
        <meta name="description" content="{{ default .Summary .Description }}">
    {{ else }}
        <title>{{ $title_plain }}</title>
        <meta name="author" content="{{ .Param "author" }}" >
        {{ if isset .Params "tags" }}{{ range .Params.tags }}{{ $keywords = $keywords | append . }}{{ end }}{{ end }}
        {{ if isset .Params "keywords" }}{{ range .Params.keywords }}{{ $keywords = $keywords | append . }}{{ end }}{{ end }}
        <meta name="description" content="{{ $description_plain }}">
    {{ end }}
    {{ hugo.Generator }}


    <!-- Bootstrap and Font Awesome CSS -->
    <link href="{{ "css/bootstrap.css" | relURL}}?t={{ mul 1000 (time now).Unix }}" rel="stylesheet">
    <link href="{{ "css/swiper.min.css" | relURL}}?t={{ mul 1000 (time now).Unix }}" rel="stylesheet">


    <!-- CSS animations  -->
    <link href="{{ "css/animate.css" | relURL}}" rel="stylesheet">

    <!-- Theme stylesheet, if possible do not edit this stylesheet -->
    {{ with .Site.Params.style }}
    <link href="{{ "css/style" | relURL}}.{{ . }}.css" rel="stylesheet" id="theme-stylesheet">
    {{ else }}
    <link href="{{ "css/style.default.css" | relURL}}?t={{ mul 1000 (time now).Unix }}" rel="stylesheet" id="theme-stylesheet">
    {{ end }}

    <!-- Download stylesheet-->
    <link href="{{ "css/style.download.css" | relURL}}?t={{ mul 1000 (time now).Unix }}" rel="stylesheet">
    <link href="{{ "css/style.mobilenav.css" | relURL}}?t={{ mul 1000 (time now).Unix }}" rel="stylesheet">
    <link href="{{ "css/style.maillist.css" | relURL}}?t={{ mul 1000 (time now).Unix }}" rel="stylesheet">
    <link href="{{ "css/style.events.css" | relURL}}?t={{ mul 1000 (time now).Unix }}" rel="stylesheet">
    <link href="{{ "css/news.css" | relURL}}?t={{ mul 1000 (time now).Unix }}" rel="stylesheet">
    <link href="{{ "css/allsite.css" | relURL}}?t={{ mul 1000 (time now).Unix }}" rel="stylesheet">
    <link href="{{ "css/contribution.css" | relURL}}?t={{ mul 1000 (time now).Unix }}" rel="stylesheet">

    <!-- Responsivity for older IE -->
    {{ `
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    ` | safeHTML }}

    <!-- Favicon and Apple touch icons-->
    <link rel="shortcut icon" href="{{ "img/favicon.ico" | relURL }}" type="image/x-icon" >
    <link rel="apple-touch-icon" href="{{ "img/apple-touch-icon.png" | relURL }}" >

    <!-- owl carousel CSS -->
    <link href="{{ "css/owl.carousel.css" | relURL}}" rel="stylesheet">
    <link href="{{ "css/owl.theme.css" | relURL}}" rel="stylesheet">

    <!-- RSS feed -->
    <link rel="alternate" href="{{ "/index.xml" | absURL }}" type="application/rss+xml" title="{{ .Site.Title }}">

    <!-- Facebook OpenGraph tags -->
    {{ $is_blog := and (eq .Type "blog") (eq .Kind "page") }}
    {{ $has_image :=  isset .Params "banner" }}
    {{ $image := cond $has_image .Params.banner (.Site.Params.default_sharing_image | default "img/sharing-default.png") }}
    {{ $is_valid_image := print "static/" $image | fileExists }}
    {{ if $is_valid_image }}
    {{ $image_ext := path.Ext $image }}
    <meta property="og:locale" content="{{ replace .Site.LanguageCode "-" "_" }}">
    <meta property="og:site_name" content="{{ .Site.Title }}">
    <meta property="og:title" content="{{ $title_plain }}">
    <meta property="og:type" content="{{ cond $is_blog "article" "website" }}">
    <meta property="og:url" content="{{ .Permalink }}" />
    <meta property="og:description" content="{{ $description_plain }}">
    <meta property="og:image" content="{{ $image | absURL }}">
    <meta property="og:image:type"
    content="image/{{ if eq $image_ext ".svg" }}svg+xml{{ else }}{{ trim $image_ext "." }}{{ end }}">
    {{ with .Params.banner_alt }}
    <meta property="og:image:alt" content="{{ . | markdownify | plainify }}">{{ end }}
    {{ $image_local :=  printf "/static/%s" $image}}
    {{ with (imageConfig $image_local) }}
    <meta property="og:image:width" content="{{ .Width }}">
    <meta property="og:image:height" content="{{ .Height }}">
    {{ end }}
    {{ end }}
    {{ with .Lastmod }}
    <meta property="og:updated_time" content="{{ .Format "2006-01-02T15:04:05Z0700" }}">{{ end }}
    {{ if $is_blog }}
    {{ with .Param "facebook_site" }}
    <meta property="article:publisher" content="https://www.facebook.com/{{ . }}/">{{ end }}
    {{ with .Param "facebook_author" }}
    <meta property="article:author" content="https://www.facebook.com/{{ . }}/">{{ end }}
    {{ with .Params.categories }}
    <meta property="article:section" content="{{ index . 0 }}">{{ end }}
    {{ range .Params.tags }}
    <meta property="article:tag" content="{{ . }}">
    {{ end }}
    {{ if gt .ExpiryDate .PublishDate }}
    <meta property="article:expiration_time" content="{{ .ExpiryDate.Format "2006-01-02T15:04:05Z0700" }}">{{ end }}
    {{ with .PublishDate }}
    <meta property="article:published_time" content="{{ .Format "2006-01-02T15:04:05Z0700" }}">{{ end }}
    {{ with .Lastmod }}
    <meta property="article:modified_time" content="{{ .Format "2006-01-02T15:04:05Z0700" }}">{{ end }}
    {{ end }}
    {{ partial "docs/html-head.html" . }}

    <!-- Theme stylesheet, you can customize scss by creating `assets/custom.scss` in your website -->
{{- $styles := resources.Get "book.scss" | resources.ExecuteAsTemplate "book.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}?t={{ mul 1000 (time now).Unix }}" integrity="{{ $styles.Data.Integrity }}">
    <!-- Custom stylesheet - for your changes -->
    <link href="{{ "css/custom.css" | relURL}}?t={{ mul 1000 (time now).Unix }}" rel="stylesheet">
</head>